package com.nervenets.template.hibernate.domain.common;

import com.nervenets.general.hibernate.DomainObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.Type;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.ArrayList;
import java.util.List;

@ApiModel("全局规则设置表")
@Entity
@Table
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class GlobalRule extends DomainObject {
    @ApiModelProperty(value = "名称")
    private String name;
    @ApiModelProperty(value = "是否启用")
    private boolean enable;
    @ApiModelProperty(value = "设置明细")
    @Builder.Default
    @Type(type = "json")
    private GlobalRuleSetting setting = new GlobalRuleSetting();
    @ApiModelProperty(value = "附件列表")
    @Builder.Default
    @Type(type = "json")
    private List<Attachment> attachments = new ArrayList<>();
}
